Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for transforming runner #8854

Merged
merged 11 commits into from
Nov 15, 2020

Conversation

Mark1626
Copy link
Contributor

Summary

Allow jest-runner to be transformable.

Part of #8810

Test plan

Have added test case for the change

@Mark1626
Copy link
Contributor Author

@SimenB e2e for pnp seems to fail, can you explain how it works, I don't have much context on it

Screenshot 2019-08-20 at 1 25 49 AM

@Mark1626
Copy link
Contributor Author

Mark1626 commented Aug 29, 2019

After much tedious debugging the culprit seems to be pirates, it seems to mutate Module._extensions

[Object: null prototype] {
      '.js': [Function],
      '.json': [Function],
      '.node': [Function],
      '': [Function] } // <- This is added

pnp is trying to module.load on node_modules/istanbul-reports/lib/json the mutation caused in Module._extensions is making it load the directory instead of the index.js.

I'll try to dig into pirates and see if it's expected or an issue

@Mark1626
Copy link
Contributor Author

Line that's the problem

https://github.com/facebook/jest/blob/95688ac9c81c19ca1bbda3aaad2a278c2a60461f/packages/jest-transform/src/ScriptTransformer.ts#L478

@Mark1626 Mark1626 force-pushed the feature/transform-runner branch from 96b0aae to cc09d52 Compare August 29, 2019 18:12
@codecov-io
Copy link

codecov-io commented Aug 29, 2019

Codecov Report

Merging #8854 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8854      +/-   ##
==========================================
+ Coverage   64.73%   64.73%   +<.01%     
==========================================
  Files         277      277              
  Lines       11707    11708       +1     
  Branches     2874     2875       +1     
==========================================
+ Hits         7578     7579       +1     
  Misses       3512     3512              
  Partials      617      617
Impacted Files Coverage Δ
packages/jest-core/src/TestScheduler.ts 65.67% <100%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc2c92b...bb7d5e5. Read the comment docs.

@Mark1626
Copy link
Contributor Author

Mark1626 commented Nov 15, 2020

Rebased it against the current master

Not sure what's the problem with CI, it's only failing for macOS, and surprisingly enough I ran it against master in my local and I got the same.


  System:
    OS: macOS 10.15.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 12.19.0
    Yarn: 2.3.3-git.20201112.db30c005
    npm: 6.14.8
  npmPackages:
    jest: workspace:* => 26.6.3


Screenshot 2020-11-15 at 10 04 28 AM

@SimenB
Copy link
Member

SimenB commented Nov 15, 2020

@Mark1626 I've opened up #10828 to track the CI failure

@SimenB
Copy link
Member

SimenB commented Nov 15, 2020

Also, could you rebase (or just merge in master) again? Conflicts with #8751

@Mark1626
Copy link
Contributor Author

I'll rebase it

@Mark1626 Mark1626 force-pushed the feature/transform-runner branch from a71ce84 to 61dab1f Compare November 15, 2020 14:15
"dependencies": {
"@babel/preset-env": "^7.0.0",
"@babel/preset-typescript": "^7.0.0",
"jest-environment-node": "^26.6.2"
Copy link
Member

@SimenB SimenB Nov 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"jest-environment-node": "^26.6.2"
"jest-environment-node": "file:../../../packages/jest-environment-node"

does that work? to avoid hard-coding a version


do we even need these dependencies? I don't see yarn being run in here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check, the changes were made before yarn berry came in, with the file: protocol I'll see if it works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with the file: protocol in my local, updating in both here and the jest-env PR

@SimenB SimenB changed the title Support for transforming runner feat: support for transforming runner Nov 15, 2020
@SimenB SimenB merged commit ed90920 into jestjs:master Nov 15, 2020
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants